<template>
  <div>
    <!--搜索-->
    <div class="searchWrap">
      <div @click="goSearch();">
        <search :text="text"></search>
      </div>
    </div>
    <!--轮播-->
    <swipers></swipers>
    <!--专区分类-->
    <div class="area">
      <div v-for="item in motto1" :key="index">
        <areaList :id="item.merchantType" :text="item.merchantTypeName" :iconImg="item.iconImg"></areaList>
      </div>
    </div>
    <scroll-view scroll-y scroll-with-animation="true">
      <!--第一专区-->
      <div v-for="(item, index) in motto1" :id="item.merchantType" :key="index">
        <areaMode :text1="item.merchantTypeName" :text2="item.url"></areaMode>
        <div v-for="(items, indexs) in item.merchantNumber" :key="indexs" @click="goodsDetails(item.merchantType, items.id);">
          <maxArea :businessImg="items.businessImg" :name="items.name" :briefly="items.briefly" :money="items.money"></maxArea>
        </div>
      </div>
      <!--特惠专区-->
      <areaMode :text1="gratia.name" :text2="gratia.url"></areaMode>
      <div v-for="item in currentContent" :key="index" @click="goodsDetails( '', item.id)">
        <minArea :businessImg="item.businessImg" :name="item.name" :briefly="item.briefly" :money="item.money"></minArea>
      </div>
    </scroll-view>
    <!--推荐完毕-->
    <showOver></showOver>
    <!--商家入驻-->
    <div @click="join()">
      <join></join>
    </div>
  </div>
</template>

<script>
  import showOver from '@/components/showOver'
  import search from '@/components/search'
  import swipers from '@/components/swipers'
  import areaList from '@/components/areaList'
  import areaMode from '@/components/areaMode'
  import maxArea from '@/components/maxArea'
  import minArea from '@/components/minArea'
  import join from '@/components/join'
  export default {
    data () {
      return {
        currentContent: this.$store.state.order,
        text: "搜索套餐",
        toView: '1',
        motto1: this.$store.state.business,
        gratia: {
          name: "特惠专区",
          url: 'url("")'
        }
      }
    },
    components: {
      search,
      swipers,
      areaList,
      areaMode,
      maxArea,
      minArea,
      join,
      showOver
    },
    methods: {
      jumpTo: function (e) {
        this.toView =e;
      },
      join: function() {
        wx.navigateTo({
          url: '/pages/hot/settled/main',
          success: function(){},       //成功后的回调；
          fail: function(){},          //失败后的回调
          complete: function(){}      //结束后的回调(成功，失败都会执行)
        });
      },
      goodsDetails: function(type, urlId,) {
        wx.navigateTo({
          url: '/pages/hot/goods/main?type='+type+"&urlId="+urlId,
        });
      },
      goSearch: function () {
        wx.navigateTo({
          url: '/pages/hot/goSearch/main'
        });
      }
    },
    // created () {
    //
    // },
    // onLoad: function () {
    //
    // }
  }
</script>

<style scoped lang=scss>
  @import "../../../static/css/index.css";
  .searchWrap {
    height:95rpx;
    width:100%;
    background:#ffffff;
    margin:0;
    padding-top:15rpx;
  }
  page{
    height: 100%;
  }
</style>
